<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增工资标准')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-salaryStandard-add">
            <div class="form-group">
                <input name="postName" type="hidden" >
                <label class="col-sm-3 control-label is-required">岗位：</label>
                <div class="col-sm-8">
                    <select name="postCode" class="form-control" required>
                        <option th:each="item : ${postList}" th:text="${item.postName}" th:value="${item.postCode}" ></option>
                    </select>
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">月基本工资标准：</label>
                <div class="col-sm-8">
                    <input name="basicWageStandard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">月固定工资标准：</label>
                <div class="col-sm-8">
                    <input name="fixedWageStandard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">月绩效工资标准：</label>
                <div class="col-sm-8">
                    <input name="performanceSalaryStandard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">月生活津贴标准：</label>
                <div class="col-sm-8">
                    <input name="subsistenceAllowanceStandard" class="form-control" type="text" required>
                </div>
            </div>


            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">岗位工资的第一级标准：</label>
                <div class="col-sm-8">
                    <input name="postSalaryStandard" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">每级增加的钱：</label>
                <div class="col-sm-8">
                    <input name="levelMoney" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('salary_standard_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/salaryStandard"
        $("#form-salaryStandard-add").validate({
            focusCleanup: true,
            rules: {

                basicWageStandard: {
                    required: true,
                    number:true
                },
                fixedWageStandard: {
                    required: true,
                    number:true
                },
                performanceSalaryStandard: {
                    required: true,
                    number:true
                },
                subsistenceAllowanceStandard: {
                    required: true,
                    number:true
                },
                postSalaryStandard: {
                    required: true,
                    number:true
                },
                levelMoney: {
                    required: true,
                    number:true
                },
                status: {
                    required: true,
                },


            },
        });


        function submitHandler() {
            if ($.validate.form()) {
                $('input[name="postName"]').val($('select[name="postCode"] option:selected').text())
                $.operate.save(prefix + "/add", $('#form-salaryStandard-add').serialize());
            }
        }
    </script>
</body>
</html>